package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.ClimateMapper;
import com.youlai.boot.system.mapper.ConstructMapper;
import com.youlai.boot.system.model.QB.Construct;
import com.youlai.boot.system.service.ConstructService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class ConstructServiceImpl extends ServiceImpl<ConstructMapper, Construct> implements ConstructService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private ConstructMapper construct;
    @Override
    public boolean saveConstruct(Construct construct) {

        construct.setAddtime(LocalDateTime.now());
        return save(construct);
    }

    @Override
    public List<Construct> getAllConstruct() {
        return construct.selectList(null);
    }

    @Override
    public boolean deleteConstructById(Integer id) {
        return baseMapper.deleteById(id) > 0;
    }
}
